﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mojsdk="clr-namespace:MOJsdk;assembly=MOJsdk">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Colors.xaml"/>
        <ResourceDictionary Source="Converters.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    
    <Style x:Key="DefaultButton" TargetType="Button">
        <Setter Property="FontFamily" Value="Segoe WP"/>
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Background" Value="{StaticResource Grey5}"/>
        <Setter Property="Foreground" Value="{StaticResource Grey2}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle x:Name="BtnBackground" Opacity="1"
                                   Fill="{TemplateBinding Background}" 
                                   StrokeThickness="0.2"
                                   Stroke="{StaticResource Grey2}" />
                        <ContentPresenter x:Name="ButtonContent"
                            VerticalAlignment="center"
                            HorizontalAlignment="center">
                            <ContentPresenter.Content>
                                <TextBlock Text="{TemplateBinding Content}" TextWrapping="Wrap" 
                                           Margin="2,2,2,2" TextAlignment="Center" />
                            </ContentPresenter.Content>
                        </ContentPresenter>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="BtnBackground" Value="{StaticResource Grey4}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="BtnBackground" Value="{StaticResource Grey3}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource Grey4}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultGrid" TargetType="Grid">
        <Setter Property="Background" Value="{StaticResource TransparentBlack}"/>
    </Style>
    <Style x:Key="DefaultCanvas" TargetType="Canvas">
        <Setter Property="Background" Value="{StaticResource Grey5}"/>
    </Style>
    <Style x:Key="DefaultListView" TargetType="ListView">
        <Setter Property="Background" Value="{StaticResource TransparentBlack}"/>
        <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Grey4}" />
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultTextBox" TargetType="TextBox">
        <Setter Property="Background" Value="{StaticResource Grey5}" />
        <Setter Property="BorderBrush" Value="{StaticResource Grey2}" />
        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Grey4}" />
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultLabel" TargetType="Label">
        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="Padding" Value="-3"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultListBox" TargetType="ListBox">
        <Setter Property="Background" Value="{StaticResource Grey5}" />
        <Setter Property="BorderBrush" Value="{StaticResource Grey2}" />
        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Grey4}" />
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultTextBlock" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultProgressBar" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
        <Setter Property="Background" Value="{StaticResource Grey5}"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Grey4}" />
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultComboBox" TargetType="ComboBox">
        <Setter Property="Foreground" Value="#FF797979" />
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="ComboBoxItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ComboBoxItem">
                                <Grid>
                                    <Rectangle x:Name="CBB_Rect" Fill="{StaticResource Grey5}" Stroke="{StaticResource Grey2}" 
                                               StrokeThickness="0.6"/>
                                    <ContentPresenter Margin="2,2,2,2" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="CBB_Rect" Property="Fill" Value="{StaticResource Grey4}" />
                                        <Setter TargetName="CBB_Rect" Property="StrokeThickness" Value="2" />
                                        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton ClickMode="Press" Name="ToggleButton" Focusable="False" Grid.Column="2"
                                      IsChecked="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
                            <ToggleButton.Template>
                                <ControlTemplate TargetType="ToggleButton">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition Width="16"/>
                                        </Grid.ColumnDefinitions>
                                        <Border BorderBrush="#FF797979" BorderThickness="1" Name="Border" 
                                                Grid.ColumnSpan="2" Background="{StaticResource Grey5}" />
                                        <Border Margin="1,1,1,1" BorderBrush="{StaticResource Grey2}" BorderThickness="0,0,1,0" 
                                                Grid.Column="0"/>
                                        <Path Margin="0,0,3,0" Data="M0,0L4,4 8,0z" HorizontalAlignment="Center"
                                              Fill="#FF5C5C5C" Name="Arrow" VerticalAlignment="Center" Width="8" Grid.Column="1"/>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="UIElement.IsMouseOver" Value="True">
                                            <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource Grey4}"/>
                                        </Trigger>
                                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                                            <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource Grey4}"/>
                                            <Setter Property="Shape.Fill" TargetName="Arrow" Value="{StaticResource Grey1}"/>
                                        </Trigger>
                                        <Trigger Property="UIElement.IsEnabled" Value="False">
                                            <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource Grey4}"/>
                                            <Setter Property="Border.BorderBrush" TargetName="Border" Value="{StaticResource Grey3}"/>
                                            <Setter Property="TextElement.Foreground" Value="{StaticResource Grey3}"/>
                                            <Setter Property="Shape.Fill" TargetName="Arrow" Value="{StaticResource Grey3}"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>
                        <ContentPresenter Margin="3,3,23,3" HorizontalAlignment="Left" Name="ContentSite" VerticalAlignment="Center"
                                          IsHitTestVisible="False" Content="{TemplateBinding ComboBox.SelectionBoxItem}">
                        </ContentPresenter>
                        <TextBox Margin="3,3,23,3" Visibility="Hidden" HorizontalAlignment="Left" Name="PART_EditableTextBox"
                                 Background="{StaticResource Grey5}" VerticalAlignment="Center" Style="{x:Null}" Focusable="True" 
                                 xml:space="preserve">
                            <TextBox.Template>
                                <ControlTemplate TargetType="TextBox">
                                    <Border Name="PART_ContentHost" Background="{StaticResource Grey5}" Focusable="False" />
                                </ControlTemplate>
                            </TextBox.Template>
                        </TextBox>
                        <Popup Placement="Bottom" Name="Popup" Focusable="False" AllowsTransparency="True"
                               IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}" PopupAnimation="Slide">
                            <Grid Name="DropDown" MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
                                  MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}" SnapsToDevicePixels="True">
                                <Border Name="DropDownBorder" BorderBrush="{StaticResource Grey2}" BorderThickness="1,1,1,1" 
                                        Background="{StaticResource Grey5}"/>
                                <ScrollViewer Margin="2,6,2,6" SnapsToDevicePixels="True">
                                    <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ItemsControl.HasItems" Value="False">
                            <Setter Property="FrameworkElement.MinHeight" TargetName="DropDownBorder" Value="95"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="#FF797979"/>
                        </Trigger>
                        <Trigger Property="ItemsControl.IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                        <Trigger Property="Window.AllowsTransparency" SourceName="Popup" Value="True">
                            <Setter Property="Border.CornerRadius" TargetName="DropDownBorder" Value="4"/>
                            <Setter Property="FrameworkElement.Margin" TargetName="DropDownBorder" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="ComboBox.IsEditable" Value="True">
                            <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
                            <Setter Property="UIElement.Visibility" TargetName="PART_EditableTextBox" Value="Visible"/>
                            <Setter Property="UIElement.Visibility" TargetName="ContentSite" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DefaultCheckBox" TargetType="CheckBox">
        <Setter Property="Foreground" Value="{StaticResource Grey1}" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultRadioButton" TargetType="RadioButton">
        <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource Grey3}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultTabControl" TargetType="TabControl">
        <Setter Property="Background" Value="{StaticResource TransparentGrey5}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Grey2}"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="TabItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="TabItem">
                                <Grid>
                                    <Rectangle x:Name="TCS_Rect" Fill="{StaticResource Grey5}" 
                                               Stroke="{StaticResource Grey2}"
                                               StrokeThickness="1.2" />
                                    <ContentPresenter Margin="3,3,3,3" HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <ContentPresenter.Content>
                                            <TextBlock TextWrapping="Wrap" Text="{TemplateBinding Header}" 
                                                       Foreground="{StaticResource Grey2}" x:Name="TCS_txt"/>
                                        </ContentPresenter.Content>
                                    </ContentPresenter>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Fill" TargetName="TCS_Rect" Value="{StaticResource Grey3}" />
                                        <Setter Property="Stroke" TargetName="TCS_Rect" Value="{StaticResource Grey1}" />
                                    </Trigger>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="Stroke" TargetName="TCS_Rect" Value="{StaticResource Grey1}" />
                                        <Setter Property="Foreground" TargetName="TCS_txt" Value="{StaticResource Grey1}" />
                                        <Setter Property="StrokeThickness" TargetName="TCS_Rect" Value="2" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DefaultMojToolButton" TargetType="{x:Type mojsdk:MojToolButton}">
        <Setter Property="FontFamily" Value="Segoe WP"/>
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Background" Value="{StaticResource Grey5}"/>
        <Setter Property="Foreground" Value="{StaticResource Grey2}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type mojsdk:MojToolButton}">
                    <Grid>
                        <Rectangle x:Name="BtnBackground" Opacity="1"
                                   Fill="{TemplateBinding Background}" 
                                   StrokeThickness="0.2"
                                   Stroke="{StaticResource Grey2}" />
                        <ContentPresenter x:Name="ButtonContent"
                            VerticalAlignment="center"
                            HorizontalAlignment="center">
                            <ContentPresenter.Content>
                                <TextBlock Text="{TemplateBinding Content}" TextWrapping="Wrap" 
                                           Margin="2,2,2,2" TextAlignment="Center" />
                            </ContentPresenter.Content>
                        </ContentPresenter>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="BtnBackground" Value="{StaticResource Grey4}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="BtnBackground" Value="{StaticResource Grey3}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource Grey4}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ImageMojToolButton" TargetType="{x:Type mojsdk:MojToolButton}">
        <Setter Property="FontFamily" Value="Segoe WP"/>
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Background" Value="{StaticResource Grey5}"/>
        <Setter Property="Foreground" Value="{StaticResource Grey2}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type mojsdk:MojToolButton}">
                    <Grid>
                        <Rectangle x:Name="BtnBackground" Opacity="1"
                                   Fill="{TemplateBinding Background}" 
                                   StrokeThickness="0.2"
                                   Stroke="{StaticResource Grey2}" />
                        <ContentPresenter />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="BtnBackground" Value="{StaticResource Grey4}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="BtnBackground" Value="{StaticResource Grey3}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource Grey4}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter Property="Foreground" Value="{StaticResource Grey1}"/>
                <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>